package com.sx.pipeline.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.sx.pipeline.R
import com.sx.pipeline.repos.http.res.BalanceRecordVO

/**
 * @Author：YY
 * @Date：2022/2/10
 * @Describe: 钱包记录列表适配器
 */
class BalanceRecordAdapter(dataList: MutableList<BalanceRecordVO>) : BaseQuickAdapter<BalanceRecordVO, BaseViewHolder>(
    R.layout.item_balance_record, dataList) {
    override fun convert(holder: BaseViewHolder, item: BalanceRecordVO) {
        holder.setText(R.id.tv_remark,item.billName)
        holder.setText(R.id.tv_time,item.createTime)

        if (item.income){
            holder.setText(R.id.tv_money,"+${item.amount}")
            holder.setTextColor(R.id.tv_money, com.sx.mvvmlibs.R.color.c_333333)
        }else{
            holder.setText(R.id.tv_money,"-${item.amount}")
            holder.setTextColor(R.id.tv_money, Color.parseColor("#F21212"))
        }
    }
}